package route

import (
	"DouBan/controller"
	"github.com/gin-gonic/gin"
)

var (
	router *gin.Engine
)

func StartServer() {
	router = gin.Default()
	userGroup := router.Group("/user")
	userGroup.GET("/captcha", CheckTokenMiddle(false), controller.UserCaptcha())
	userGroup.POST("/register", CheckTokenMiddle(true), controller.UserRegister())
	userGroup.POST("/login", CheckTokenMiddle(true), controller.UserLogin())
	jobGroup := router.Group("/job", CheckTokenMiddle(true))
	jobGroup.POST("/subscribe", controller.JobSubscribe())
	_ = router.Run(":8888")
}
